<template>
  <div :style="conheight">
    <Tabs v-model="currentabName" animated:false>
      <TabPane label="作业任务" name="name1" style="height:100%">
        <div :style="tabHeight">
          <Form style="flex-grow:1" ref="formData" :model="formData" :rules="ruleCustom" :label-width="120"
                label-position="right">
            <Row type="flex" justify="space-around" class="code-row-bg">
              <Col span="16">
                <FormItem label="任务名称：" prop="planName">
                  <Input v-model="formData.planName"/>
                </FormItem>
              </Col>
            </Row>
            <Row type="flex" justify="space-around" class="code-row-bg">
              <Col span="16">
                <FormItem label="任务单位类型：" prop="orgType">
                  <RadioGroup v-model="formData.orgType" @on-change="changeType">
                    <Radio label="0" value="0">内部单位</Radio>
                    <Radio label="1" value="1">相关方</Radio>
                  </RadioGroup>
                </FormItem>
              </Col>
            </Row>
            <Row type="flex" justify="center" class="code-row-bg">
              <Col span="8">
                <FormItem label="所属单位：" prop="belongOrgId">
                  <cascaderDom ref="belongOrg" @setOrgInfo="setBelongOrgId" @setOrgname="setBelongOrgName"
                               :currentOrgId="formData.belongOrgId"
                               :currentOrgName="formData.belongOrgName" :rootAffordIf="true" :orgTree="true"
                               :rootOrgId="rootOrgId"></cascaderDom>
                </FormItem>
              </Col>
              <Col span="8">
                <FormItem label="作业单位：" prop="operateOrgId">
                  <cascaderDom v-if="formData.orgType=='0'" ref="operateOrg" @setOrgInfo="setOperateOrgId"
                               @setOrgname="setOperateOrgName" :currentOrgId="formData.operateOrgId"
                               :currentOrgName="formData.operateOrgName" :rootAffordIf="true" :orgTree="true"
                               :rootOrgId="rootOrgId"></cascaderDom>
                  <Input v-else v-model="formData.operateOrgName" @on-focus="chooseRelatedParty()"/>
                </FormItem>
              </Col>
            </Row>
            <Row type="flex" justify="space-around" class="code-row-bg">
              <Col span="16">
                <FormItem label="作业时间：" prop="workDate">
                  <DatePicker style="width:100%" type="date" :options="dateDisabledOption" placement="top" v-model="formData.workDate"></DatePicker>
                </FormItem>
              </Col>
            </Row>
            <Row type="flex" justify="space-around" class="code-row-bg">
              <Col span="16">
                <FormItem label="作业描述：" prop="workDesc">
                  <Input type="textarea" :rows="4" v-model="formData.workDesc"></Input>
                </FormItem>
              </Col>
            </Row>
          </Form>
          <div style="display:flex;justify-content:center">
            <Button class='ivu-btn-save' style="margin-right:20px" @click="submit()">保存</Button>
            <Button class='ivu-btn-cancel' @click="handleCancel">返回</Button>
          </div>
        </div>
      </TabPane>
      <TabPane label="作业票" name="name2" :disabled="currentPlanId == '' || currentPlanId == undefined">
        <div :style="tab2Height">
          <Card bordered dis-hover class="model-list-css">
            <p slot="title">作业模板</p>
            <a href="#" slot="extra" @click.prevent="selectModel">
              <Icon type="md-add"/>
            </a>
            <div style="flex:auto;height:100%;overflow-y:auto;overflow-x:hidden">
              <div v-for="(item,index) in currentPtwModels" class="PtwModelListClass">
                <div :class="{changeStyle:changeSelectStyle == index}" @click="changeStyle(index)"
                     style="display:flex;justify-content:space-between">
                  <p class="wenben" @click="clickModel(index,item.ptwId,item.modelId)">{{ item.modelName }}</p>
                  <p class="wenben" @click="deleteModel(index,item.ptwId)">x</p>
                </div>
              </div>
            </div>
          </Card>
          <div style="flex:auto;display:flex;flex-direction:column;height:100%;">
            <Spin style="width:100%;heigth:100%;margin-left:45%;margin-top:200px" size="large"
                  v-if="loadingModel"></Spin>
            <div v-else style="flex:auto;height:100%;overflow-y:auto;overflow-x:auto;padding:5px;background-color:grey">
              <Form ref="ptwData" :model="ptwData" :rules="ptwRuleCustom" :label-width="170" label-position="right">
                <Card shadow v-if="modelData.modelType=='ptw-100001000000001'">  <!-- 吊装-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="汽车吊（t）：" prop="craneQuality">
                              <InputNumber :min="1" style="width:100%" v-model="ptwData.craneQuality"></InputNumber>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="吊装质量（t）：" prop="hoistingQuality">
                              <InputNumber :min="1" style="width:100%" v-model="ptwData.hoistingQuality"></InputNumber>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="吊装高度（m）：" prop="hoistingHeight">
                              <InputNumber :min="1" style="width:100%" v-model="ptwData.hoistingHeight"></InputNumber>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业等级：" prop="workGrade">
                              <Poptip trigger="hover" title="" placement="left">
                                <RadioGroup v-model="ptwData.workGrade">
                                  <Radio v-for="(item,index) in workGrades" :label="item.codingCodeId"
                                         :key="item.codingCodeId">{{ item.codingName }}
                                  </Radio>
                                </RadioGroup>
                                <div slot="content">
                                  <p>一级吊装：汽车吊＞100t或吊装质量＞40t或吊装高度＞60m</p>
                                  <p>二级吊装：汽车吊50t— 100t或吊装质量10t—40t或吊装高度20—60m</p>
                                  <p>三级吊装：汽车吊＜50t或吊装质量＜10t或吊装高度＜20m</p>
                                </div>
                              </Poptip>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业人员：" prop="workPeople">
                              <Input type="text" v-model="ptwData.workPeople"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业负责人：" prop="workCharge">
                              <Input type="text" v-model="ptwData.workCharge"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="司索人员：" prop="cablePeople">
                              <Input type="text" v-model="ptwData.cablePeople"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="现场监护人：" prop="siteGuarder">
                              <Input type="text" v-model="ptwData.siteGuarder"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="起重指挥：" prop="craneDirect">
                              <Input type="text" v-model="ptwData.craneDirect"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="现场指挥：" prop="siteDirect">
                              <Input type="text" v-model="ptwData.siteDirect"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="起重司机：" prop="craneDriver">
                              <Input type="text" v-model="ptwData.craneDriver"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000002'">  <!-- 清库清仓-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业人员及证号：" prop="workPeople">
                              <Input type="text" v-model="ptwData.workPeople"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业负责人：" prop="workCharge">
                              <Input type="text" v-model="ptwData.workCharge"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="现场监护人：" prop="siteGuarder">
                              <Input type="text" v-model="ptwData.siteGuarder"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow
                      v-if="modelData.modelType=='ptw-100001000000006' || modelData.modelType=='ptw-100001000000007'  ">
                  <!--清库清仓作业许可-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="23">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="23">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业负责人：" prop="workCharge">
                              <Input type="text" v-model="ptwData.workCharge"></Input>
                            </FormItem>
                          </Col>
                        </Row>

                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业人员：" prop="workPeople">
                              <Input type="text" v-model="ptwData.workPeople"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="现场监护人：" prop="siteGuarder">
                              <Input type="text" v-model="ptwData.siteGuarder"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000003'"> <!--有限空间-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="23">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业等级：" prop="workGrade">
                              <Poptip trigger="hover" title="" placement="left">
                                <RadioGroup v-model="ptwData.workGrade">
                                  <Radio v-for="(item,index) in confinedSpaceWorkGrades" :label="item.codingCodeId"
                                         :key="item.codingCodeId">{{ item.codingName }}
                                  </Radio>
                                </RadioGroup>
                                <div slot="content">
                                  <p>特级：封闭式污水处理池、封闭式氨水回收池、封闭式危废储存池或储罐等检维修</p>
                                  <p> 作业（各类储库清理执行清库作业要求）。</p>
                                  <p>一级：关联、上下游设备及自身在运行状态下的立式磨、球磨机、选粉机、蒸压釜、</p>
                                  <p> 烘干机、回转窑、篦冷机、增湿塔、热风炉、分离器、压力容器、锅炉、电袋除尘器、</p>
                                  <p> 分解炉、预热器及管道、危废处置地坑；危废贮存容器、氨水罐、半封闭污水处理池、</p>
                                  <p> 封闭式油池等检维修作业。</p>
                                  <p>二级：关联、上下游设备及自身在检修状态下的立式磨、球磨机、选粉机、蒸压釜、烘干机、</p>
                                  <p> 回转窑、篦冷机、增湿塔、热风炉、分离器、压力容器、锅炉、电袋除尘器、分解炉、</p>
                                  <p> 预热器及管道、烟室、旋风筒、风管、下料管、危废贮存容器、危废处置地坑、商砼搅拌机、</p>
                                  <p> 窨井、半封闭式蓄水池、矿山封闭式溜槽、常压罐车、半封闭式容器、半封闭电缆隧道、</p>
                                  <p> 半封闭式蓄水池、半封闭式地下坑道等检维修作业。</p>
                                </div>
                              </Poptip>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业人员：" prop="workPeople">
                              <Input type="text" v-model="ptwData.workPeople"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="现场监护人：" prop="siteGuarder">
                              <Input type="text" v-model="ptwData.siteGuarder"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业负责人：" prop="workCharge">
                              <Input type="text" v-model="ptwData.workCharge"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000004'"> <!--高处作业许可-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="23">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="基准面（m）：" prop="datumGrade">
                              <Input type="text" v-model="ptwData.datumGrade"/>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业等级：" prop="workGrade">
                              <Poptip trigger="hover" title="" placement="left">
                                <RadioGroup v-model="ptwData.workGrade">
                                  <Radio v-for="(item,index) in highWorkGrades" :label="item.codingCodeId"
                                         :key="item.codingCodeId">{{ item.codingName }}
                                  </Radio>
                                </RadioGroup>
                                <div slot="content">
                                  <p>特级高处作业：基准面30米以上</p>
                                  <p>三级高处作业：基准面15—30米</p>
                                  <p>二级高处作业：基准面5—15米</p>
                                  <p>一级高处作业：基准面2—5米</p>
                                </div>
                              </Poptip>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业人员及证号：" prop="workPeople">
                              <Input type="text" v-model="ptwData.workPeople"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业负责人：" prop="workCharge">
                              <Input type="text" v-model="ptwData.workCharge"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="现场监护人：" prop="siteGuarder">
                              <Input type="text" v-model="ptwData.siteGuarder"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000005'"> <!--动火作业许可-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="23">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业等级：" prop="workGrade">
                              <Poptip trigger="hover" title="" placement="left">
                                <RadioGroup v-model="ptwData.workGrade">
                                  <Radio label="ptw-100003000000001">特殊动火</Radio>
                                  <Radio label="ptw-100003000000002">一级动火</Radio>
                                  <Radio label="ptw-100003000000003">二级动火</Radio>
                                </RadioGroup>
                                <div slot="content">
                                  <p>特殊动火作业：处于运行状态的易燃、易爆场所内的动火作业。包括柴油库、输油管道、</p>
                                  <p> 氧气乙炔气瓶库、煤磨、煤粉输送管道、危废贮存场所、危废处置场所、</p>
                                  <p> 总降变电站、高低压电气室、压力管道、锅炉、压力容器等。</p>
                                  <p>一级动火作业：处于检修状态的易燃、易爆场所内的动火作业。包括检修状态的煤磨、</p>
                                  <p> 煤粉输送管道、煤粉仓、煤磨袋除尘器、氨水罐区、锅炉、压力容器、
                                  <p> 危废贮存场所、危废处置场所、总降变电站、高低压电气室、原煤堆场等。 </p>
                                  <p>二级动火作业：停车检修，经清洗置换并采取安全隔离措施后，火灾、爆炸危险性比较小的</p>
                                  <p> 场所内动火作业。包括：氨水储存区半径25 m范围内、稀油站、纸袋仓库、</p>
                                  <p> 空压机站、原煤输送设备、食堂操作间、宿舍楼、档案室、汽车库、停车棚等</p>
                                  <p> 存在一定火灾风险的其他场所。</p>
                                </div>
                              </Poptip>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业负责人：" prop="workCharge">
                              <Input type="text" v-model="ptwData.workCharge"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="现场监护人：" prop="siteGuarder">
                              <Input type="text" v-model="ptwData.siteGuarder"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业人员及证号：" prop="workPeople">
                              <Input type="text" v-model="ptwData.workPeople"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000008'"> <!--临时用电作业许可-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请用电地点：" prop="applyUseElectricSite">
                              <Input type="text" v-model="ptwData.applyUseElectricSite"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="用电功率：" prop="useElectricPower">
                              <Input type="text" v-model="ptwData.useElectricPower"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请供电制式：" prop="electricStandard">
                              <RadioGroup v-model="ptwData.electricStandard">
                                <Radio label="1">单相</Radio>
                                <Radio label="2">三相四线</Radio>
                                <Radio label="3">三相五线</Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="电源接入点：" prop="electricAccessPoint">
                              <Input type="textarea" v-model="ptwData.electricAccessPoint"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="计划用电天数：" prop="applyUseElectricDay">
                              <InputNumber :min="1" style="width:100%"
                                           v-model="ptwData.applyUseElectricDay"></InputNumber>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="操作类型：" prop="electricType">
                              <RadioGroup v-model="ptwData.electricType">
                                <Radio label="1">安装</Radio>
                                <Radio label="2">拆除</Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="操作时间：" prop="electricWorkTime">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.electricWorkTime"
                                          placement="bottom-end"
                                          placeholder="选择操作时间" style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="验收时间：" prop="electricCheckTime">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.electricCheckTime"
                                          placement="bottom-end"
                                          placeholder="选择验收时间" style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请用电开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请用电结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="11">
                        <FormItem label="电工签名：" prop="eleWorkerName">
                          <Upload
                              multiple
                              action=""
                              :before-upload="beforeUploadEleWorkerNameSign"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                            <div v-if="fileItem.fileName.indexOf('eleWorkerNameSign')!=-1">
                              <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                              </router-link>
                              <a @click="downloadFiles(fileItem)"><span
                                  style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                              </a>
                              <a @click="signFileRemove(index,fileItem.id)"><span
                                  style="color: #3399ff;margin-left: 5px">删除</span>
                              </a>
                            </div>
                          </div>
                        </FormItem>
                      </Col>
                      <Col span="11">
                        <FormItem label="验收人签名：" prop="eleCheckerName">
                          <Upload
                              multiple
                              action=""
                              :before-upload="beforeUploadEleCheckerNameSign"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                            <div v-if="fileItem.fileName.indexOf('eleCheckerNameSign')!=-1">
                              <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                              </router-link>
                              <a @click="downloadFiles(fileItem)"><span
                                  style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                              </a>
                              <a @click="signFileRemove(index,fileItem.id)"><span
                                  style="color: #3399ff;margin-left: 5px">删除</span>
                              </a>
                            </div>
                          </div>
                        </FormItem>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000009'"> <!--高温作业许可-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业等级：" prop="workGrade">
                              <RadioGroup v-model="ptwData.workGrade">
                                <Radio label="item.codingCodeId" :key="item.codingCodeId">{{ item.codingName }}</Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业人员及证号：" prop="workPeople">
                              <Input type="text" v-model="ptwData.workPeople"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业负责人：" prop="workCharge">
                              <Input type="text" v-model="ptwData.workCharge"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="现场监护人：" prop="siteGuarder">
                              <Input type="text" v-model="ptwData.siteGuarder"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000010'"> <!--交叉作业许可-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业项目简述：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业类型：" prop="workType">
                              <RadioGroup v-model="ptwData.workType">
                                <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                       :key="item.codingCodeId">{{ item.codingName }}
                                </Radio>
                              </RadioGroup>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="bottom-end"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000010'"> <!--交叉-->
                  <p slot="title">相关方列表</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Button style="margin-top:20px" class="ivu-btn-add" icon="md-add" @click="addRelatedParty()">
                          新增
                        </Button>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Table class="tableClass" highlight-row stripe border
                               style="overflow-y:auto;"
                               :height="200" :columns="relatedPartyColumn" :data="relatedPartyDatas">
                          <template slot-scope="{ row, index }" slot="relatedPartyName">
                            <Input type="textarea" :autosize="{minRows:2,maxRows:5}"
                                   v-model="relatedPartyDatas[index].relatedPartyName"/>
                          </template>
                          <template slot-scope="{ row, index }" slot="contactPerson">
                            <Input type="textarea" :autosize="{minRows:2,maxRows:5}"
                                   v-model="relatedPartyDatas[index].contactPerson"/>
                          </template>
                          <template slot-scope="{ row, index }" slot="contactPhone">
                            <Input type="textarea" style="width:100%" v-model="relatedPartyDatas[index].contactPhone"/>
                          </template>
                          <template slot-scope="{ row, index }" slot="actions">
                            <Button :autosize="{minRows:2,maxRows:5}" @click="deleteRelatedParty(index)">删除</Button>
                          </template>
                        </Table>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000011'"> <!--动土作业许可-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Row>
                      <Col span="24">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="主管部门(申请部门)：" prop="adminDept">
                              <Input type="text" v-model="ptwData.adminDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                              <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业部门/单位：" prop="workDept">
                              <Input type="text" v-model="ptwData.workDept"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="属地管理部门：" prop="colonyDept">
                              <Input type="text" v-model="ptwData.colonyDept"></Input>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="作业内容：" prop="projectDesc">
                              <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="作业等级：" prop="workGrade">
                              <Poptip trigger="hover" title="" placement="left">
                                <RadioGroup v-model="ptwData.workGrade">
                                  <Radio v-for="(item,index) in soilWorkGrades" :label="item.codingCodeId"
                                         :key="item.codingCodeId">{{ item.codingName }}
                                  </Radio>
                                </RadioGroup>
                                <div slot="content">
                                  <p>交通次干道动土作业</p>
                                  <p>交通主干道动土作业</p>
                                </div>
                              </Poptip>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                          <Col span="11">
                            <FormItem label="申请作业开始时间：" prop="applyStartDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                          placement="left"
                                          @on-change="changeDate" placeholder="选择开始时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                          <Col span="11">
                            <FormItem label="申请作业结束时间：" prop="applyEndDate">
                              <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                          placement="left"
                                          @on-change="changeDate" placeholder="选择结束时间"
                                          style="width: 100%"></DatePicker>
                            </FormItem>
                          </Col>
                        </Row>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow
                      v-if="modelData.modelType=='ptw-100001000000020' || modelData.modelType=='ptw-100001000000021'">
                  <!-- 爆破作业，盲炮处理-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Form ref="ptwData" :model="ptwData" :rules="ptwRuleCustom" :label-width="160"
                          label-position="right">
                      <Row>
                        <Col span="24">
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="主管部门(申请部门)：" prop="adminDept">
                                <Input type="text" v-model="ptwData.adminDept"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                                <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业部门/单位：" prop="workDept">
                                <Input type="text" v-model="ptwData.workDept"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="属地管理部门：" prop="colonyDept">
                                <Input type="text" v-model="ptwData.colonyDept"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业类型：" prop="workType">
                                <RadioGroup v-model="ptwData.workType">
                                  <Radio v-for="(item,index) in workTypes" :label="item.codingCodeId"
                                         :key="item.codingCodeId">{{ item.codingName }}
                                  </Radio>
                                </RadioGroup>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="作业项目简述：" prop="projectDesc">
                                <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业负责人：" prop="workCharge">
                                <Input type="text" v-model="ptwData.workCharge"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="现场监护人：" prop="siteGuarder">
                                <Input type="text" v-model="ptwData.siteGuarder"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="申请作业开始时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                            placement="bottom-end"
                                            placeholder="选择开始时间" style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="申请作业结束时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                            placement="bottom-end" placeholder="选择结束时间"
                                            style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                          </Row>
                        </Col>
                      </Row>
                    </Form>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000022'">  <!-- 大型铸件合浇作业-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Form ref="ptwData" :model="ptwData" :rules="ptwRuleCustom" :label-width="160"
                          label-position="right">
                      <Row>
                        <Col span="24">
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="主管部门(申请部门)：" prop="adminDept">
                                <Input type="text" v-model="ptwData.adminDept"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="主管部门协调员：" prop="adminDeptExpediter">
                                <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业部门/单位：" prop="workDept">
                                <Input type="text" v-model="ptwData.workDept"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="属地管理部门：" prop="colonyDept">
                                <Input type="text" v-model="ptwData.colonyDept"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label="作业项目简述：" prop="projectDesc">
                                <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业人员：" prop="workPeople">
                                <Input v-model="ptwData.workPeople"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业负责人：" prop="workCharge">
                                <Input type="text" v-model="ptwData.workCharge"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="现场监护人：" prop="siteGuarder">
                                <Input type="text" v-model="ptwData.siteGuarder"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="申请作业开始时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                            placement="bottom-end"
                                            placeholder="选择开始时间" style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="申请作业结束时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                            placement="bottom-end" placeholder="选择结束时间"
                                            style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                          </Row>
                        </Col>
                      </Row>
                    </Form>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000025'">  <!-- 断路作业-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Form ref="ptwData" :model="ptwData" :rules="ptwRuleCustom" :label-width="160"
                          label-position="right">
                      <Row>
                        <Col span="24">
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="申请单位：" prop="adminDept">
                                <Input type="text" v-model="ptwData.adminDept"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="申请人：" prop="adminDeptExpediter">
                                <Input type="text" v-model="ptwData.adminDeptExpediter"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业单位：" prop="workDept">
                                <Input type="text" v-model="ptwData.workDept"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="作业编号：" prop="workPeople">
                                <Input type="text" v-model="ptwData.workPeople"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label="涉及相关单位（部门）：" prop="colonyDept">
                                <Input type="textarea" v-model="ptwData.colonyDept"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label="断路原因：" prop="brokenReason">
                                <Input type="textarea" v-model="ptwData.brokenReason"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="断路开始时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                            placement="bottom-end"
                                            placeholder="选择开始时间" style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="断路结束时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                            placement="bottom-end" placeholder="选择结束时间"
                                            style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label="断路地段示意图及相关说明：" prop="brokenExplain">
                                <Input v-model="ptwData.brokenExplain"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label="附件：" prop="file">
                                <Upload
                                    multiple
                                    :before-upload="beforeUploadBrokenExplainPhoto"
                                    ref="upload"
                                    type="drag"
                                    name="files"
                                    :format="['jpg','jpeg','png']"
                                >
                                  <div style="padding: 5px 0">
                                    <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                    <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                                  </div>
                                </Upload>
                                <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                                  <div v-if="fileItem.fileName.indexOf('file')!=-1">
                                    <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                      <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                                    </router-link>
                                    <a @click="downloadFiles(fileItem)"><span
                                        style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                                    </a>
                                    <a @click="signFileRemove(index,fileItem.id)"><span
                                        style="color: #3399ff;margin-left: 5px">删除</span>
                                    </a>
                                  </div>
                                </div>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label="危害辨识：" prop="hazardIdentification">
                                <Input type="text" v-model="ptwData.hazardIdentification"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                        </Col>
                      </Row>
                    </Form>
                  </div>
                </Card>
                <Card shadow
                      v-if="modelData.modelType=='ptw-100001000000023' || modelData.modelType=='ptw-100001000000024'">
                  <!-- 斜拉链作业-->
                  <p slot="title">基础信息</p>
                  <div>
                    <Form ref="ptwData" :model="ptwData" :rules="ptwRuleCustom" :label-width="160"
                          label-position="right">
                      <Row>
                        <Col span="24">
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="管理单位：" prop="adminDept">
                                <Input type="text" v-model="ptwData.adminDept"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="作业单位：" prop="workDept">
                                <Input type="text" v-model="ptwData.workDept"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业地点：" prop="workSite">
                                <Input type="text" v-model="ptwData.workSite"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="作业高度：" v-if="modelData.modelType=='ptw-100001000000024'"
                                        prop="workHeight">
                                <Input type="text" v-model="ptwData.workHeight"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                              <FormItem label="作业内容：" prop="projectDesc">
                                <Input type="textarea" v-model="ptwData.projectDesc"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="作业人：" prop="workPeople">
                                <Input v-model="ptwData.workPeople"></Input>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="监护人：" prop="siteGuarder">
                                <Input v-model="ptwData.siteGuarder"></Input>
                              </FormItem>
                            </Col>
                          </Row>
                          <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                              <FormItem label="申请作业开始时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyStartDate" :options="dateDisabledOption"
                                            placement="bottom-end"
                                            placeholder="选择开始时间" style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                            <Col span="11">
                              <FormItem label="申请作业结束时间：" prop="applyWorkDate">
                                <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="ptwData.applyEndDate" :options="dateDisabledOption"
                                            placement="bottom-end" placeholder="选择结束时间"
                                            style="width: 100%"></DatePicker>
                              </FormItem>
                            </Col>
                          </Row>
                        </Col>
                      </Row>
                    </Form>
                  </div>
                </Card>
                <Card shadow
                      v-if="modelData.modelType=='ptw-100001000000024' || modelData.modelType=='ptw-100001000000023'">
                  <!--交叉-->
                  <p slot="title">特种作业人员列表</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Button style="margin-top:20px" class="ivu-btn-add" icon="md-add" @click="addPtwWorker()">新增
                        </Button>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Table class="tableClass" highlight-row stripe border
                               style="overflow-y:auto;"
                               :height="200" :columns="ptwWorkerColumn" :data="ptwWorkerDatas">
                          <template slot-scope="{ row, index }" slot="userName">
                            <Input type="text" v-model="ptwWorkerDatas[index].userName"/>
                          </template>
                          <template slot-scope="{ row, index }" slot="userType">
                            <Select v-model="ptwWorkerDatas[index].userType" transfer="true" style="width:120px">
                              <Option value="1">高处作业</Option>
                              <Option value="2">焊工作业</Option>
                              <Option value="3">起重作业</Option>
                              <Option value="4">电工作业</Option>
                            </Select>
                          </template>
                          <template slot-scope="{ row, index }" slot="userNumber">
                            <Input type="text" v-model="ptwWorkerDatas[index].userNumber"/>
                          </template>
                          <template slot-scope="{ row, index }" slot="actions">
                            <Button @click="deletePtwWorker(index)">删除</Button>
                          </template>
                        </Table>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card bordered dis-hover :key="item.modelSubId" v-for="(item,index) in workItems" shadow>
                  <p slot="title">
                    {{ item.parentModelSubName != null ? item.parentModelSubName + "-" : "" }}{{ item.modelSubName }}：{{ item.modelSubDesc }}
                  </p>
                  <div class="modelSub" v-if="item.modelSubName.indexOf('控制措施')!=-1">
                    <Row :class="rowIndex%2==0?detailRow1:detailRow2" v-for="(row,rowIndex) in item.rows"
                         :key="row.itemId">
                      <Col span="6" v-for="child in row" :key="child.itemId"
                           style="padding-left: 10px;border-right: 1px solid #E0E0EC;">
                        <span v-if="child.itemId!=undefined && child.dataType=='3'" style="color:red">*</span>
                        <span v-if="child.itemId!=undefined && child.dataType!='2'">{{ child.itemName }}<br>
                                                <RadioGroup v-model="child.instanceContent">
                                                    <Radio label="1">是</Radio>
                                                    <Radio label="0">否</Radio>
                                                </RadioGroup>
                                            </span>
                        <span v-if="child.itemId!=undefined && child.dataType=='2'">{{ child.itemName }}<br>
                                                <Poptip trigger="hover" title="" placement="left">
                                                    <div slot="content">
                                                        <p style="white-space: normal">{{ child.instanceContent }}</p>
                                                    </div>
                                                    <input type="text" style="height: 35px"
                                                           v-model="child.instanceContent"
                                                           @change="getChildPosition(index,child.itemId,child.instanceContent)"></input>
                                                </Poptip>
                                            </span>
                        <div>
                          <div v-for="fileItem in imgs" :key='fileItem.id' v-if="fileItem.field == child.itemId">
                            <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                              <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                            </router-link>
                            <a @click="downloadFiles(fileItem)"><span
                                style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                            </a>
                            <!--     <a @click="remove1(fileItem.id)"><span
                                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                                </a> -->
                          </div>
                        </div>
                      </Col>
                    </Row>
                  </div>
                  <div class="modelSub" v-if="item.modelSubName.indexOf('风险分析')!=-1">
                    <Row :class="rowIndex%2==0?detailRow1:detailRow2" v-for="(row,rowIndex) in item.rows"
                         :key="row.itemId">
                      <Col span="6" v-for="child in row" :key="child.itemId"
                           style="padding-left: 10px;border-right: 1px solid #E0E0EC;">
                        <span v-if="child.itemId!=undefined && child.dataType=='3'"
                              style="float:left;color:red">*</span>
                        <Checkbox true-value="1" v-model="child.instanceContent"
                                  v-if="child.itemId!=undefined && child.dataType!='2'" label="1">
                          <span>{{ child.itemName }}</span>
                        </Checkbox>
                        <span v-if="child.itemId!=undefined && child.dataType=='2'">{{ child.itemName }}<br>
                            <Poptip trigger="hover" title="" placement="left">
                                <div slot="content">
                                    <p style="white-space: normal">{{ child.instanceContent }}</p>
                                </div>
                                <input type="text" style="height: 35px"
                                        v-model="child.instanceContent"
                                        @change="getChildPosition(index,child.itemId,child.instanceContent)"></input>
                            </Poptip>
                        </span>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType!=undefined&&modelData.modelType!=''
                            &&modelData.modelType!='ptw-100001000000020'&&modelData.modelType!='ptw-100001000000021'
                            &&modelData.modelType!='ptw-100001000000023'
                            &&modelData.modelType!='ptw-100001000000024'&&modelData.modelType!='ptw-100001000000025'">
                  <p slot="title">现场确认</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <p>本人已清楚本次作业的风险和控制措施，将严格遵守相关要求并确认所有安全措施已落实到位。</p>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <FormItem label="作业人员确认签字：" prop="workPeopleSign">
                          <Upload
                              multiple
                              action=""
                              :before-upload="beforeUploadWorkPeopleSign"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                            <div v-if="fileItem.fileName.indexOf('workPeopleSign')!=-1">
                              <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                              </router-link>
                              <a @click="downloadFiles(fileItem)"><span
                                  style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                              </a>
                              <a @click="signFileRemove(index,fileItem.id)"><span
                                  style="color: #3399ff;margin-left: 5px">删除</span>
                              </a>
                            </div>
                          </div>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <FormItem label="监护人确认签字：" prop="siteGuarderSign">
                          <Upload
                              action=""
                              multiple
                              :before-upload="beforeUploadSiteGuarderSign"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                            <div v-if="fileItem.fileName.indexOf('siteGuarderSign')!=-1">
                              <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                              </router-link>
                              <a @click="downloadFiles(fileItem)"><span
                                  style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                              </a>
                              <a @click="signFileRemove(index,fileItem.id)"><span
                                  style="color: #3399ff;margin-left: 5px">删除</span>
                              </a>
                            </div>
                          </div>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <FormItem label="作业负责人确认签字：" prop="workChargeSign">
                          <Upload
                              action=""
                              multiple
                              :before-upload="beforeUploadWorkChargeSign"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                            <div v-if="fileItem.fileName.indexOf('workChargeSign')!=-1">
                              <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                              </router-link>
                              <a @click="downloadFiles(fileItem)"><span
                                  style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                              </a>
                              <a @click="signFileRemove(index,fileItem.id)"><span
                                  style="color: #3399ff;margin-left: 5px">删除</span>
                              </a>
                            </div>
                          </div>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <FormItem label="附件：" prop="workPeopleSign">
                          <Upload
                              action=""
                              multiple
                              :before-upload="beforeUploadConfirmPhoto"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signPhotoFileList" :key='fileItem.id'>
                            <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                              <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                            </router-link>
                            <a @click="downloadFiles(fileItem)"><span
                                style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                            </a>
                            <a @click="signPhotoRemove(index,fileItem.id)"><span
                                style="color: #3399ff;margin-left: 5px">删除</span>
                            </a>
                          </div>
                        </FormItem>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000025'">
                  <p slot="title">现场确认</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <p>本人已清楚本次作业的风险和控制措施，将严格遵守相关要求并确认所有安全措施已落实到位。</p>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <FormItem label="实施安全教育人：" prop="workPeopleSign">
                          <Upload
                              multiple
                              action=""
                              :before-upload="beforeUploadWorkPeopleSign"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                            <div v-if="fileItem.fileName.indexOf('workPeopleSign')!=-1">
                              <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                              </router-link>
                              <a @click="downloadFiles(fileItem)"><span
                                  style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                              </a>
                              <a @click="signFileRemove(index,fileItem.id)"><span
                                  style="color: #3399ff;margin-left: 5px">删除</span>
                              </a>
                            </div>
                          </div>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <FormItem label="附件：" prop="workPeopleSign">
                          <Upload
                              action=""
                              multiple
                              :before-upload="beforeUploadConfirmPhoto"
                              ref="upload"
                              type="drag"
                              name="files"
                              :format="['jpg','jpeg','png']"
                          >
                            <div style="padding: 5px 0">
                              <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                              <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                            </div>
                          </Upload>
                          <div v-for="(fileItem,index) in signPhotoFileList" :key='fileItem.id'>
                            <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                              <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                            </router-link>
                            <a @click="downloadFiles(fileItem)"><span
                                style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                            </a>
                            <a @click="signPhotoRemove(index,fileItem.id)"><span
                                style="color: #3399ff;margin-left: 5px">删除</span>
                            </a>
                          </div>
                        </FormItem>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow
                      v-if="modelData.modelType=='ptw-100001000000020' || modelData.modelType=='ptw-100001000000021'">
                  <p slot="title">现场确认</p>
                  <div>
                    <Form :rules="ptwRuleCustom" :label-width="180" label-position="right">
                      <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                          <FormItem label="爆破班组长签字：" prop="chargePeopleSign">
                            <Upload
                                multiple
                                :before-upload="beforeUploadChargePeopleSign"
                                ref="upload"
                                type="drag"
                                name="files"
                                :format="['jpg','jpeg','png']"
                            >
                              <div style="padding: 5px 0">
                                <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                              </div>
                            </Upload>
                            <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                              <div v-if="fileItem.fileName.indexOf('chargePeopleSign')!=-1">
                                <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                  <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                                </router-link>
                                <a @click="downloadFiles(fileItem)"><span
                                    style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                                </a>
                                <a @click="signFileRemove(index,fileItem.id)"><span
                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                </a>
                              </div>
                            </div>
                          </FormItem>
                        </Col>
                      </Row>
                      <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                          <FormItem label="爆破安全员签字：" prop="securityGuardSign">
                            <Upload
                                multiple
                                :before-upload="beforeUploadSecurityGuardSign"
                                ref="upload"
                                type="drag"
                                name="files"
                                :format="['jpg','jpeg','png']"
                            >
                              <div style="padding: 5px 0">
                                <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                              </div>
                            </Upload>
                            <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                              <div v-if="fileItem.fileName.indexOf('securityGuardSign')!=-1">
                                <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                  <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                                </router-link>
                                <a @click="downloadFiles(fileItem)"><span
                                    style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                                </a>
                                <a @click="signFileRemove(index,fileItem.id)"><span
                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                </a>
                              </div>
                            </div>
                          </FormItem>
                        </Col>
                      </Row>
                      <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                          <FormItem label="爆破技术员签字：" prop="technicianSign">
                            <Upload
                                multiple
                                :before-upload="beforeUploadTechnicianSign"
                                ref="upload"
                                type="drag"
                                name="files"
                                :format="['jpg','jpeg','png']"
                            >
                              <div style="padding: 5px 0">
                                <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                              </div>
                            </Upload>
                            <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                              <div v-if="fileItem.fileName.indexOf('technicianSign')!=-1">
                                <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                  <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                                </router-link>
                                <a @click="downloadFiles(fileItem)"><span
                                    style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                                </a>
                                <a @click="signFileRemove(index,fileItem.id)"><span
                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                </a>
                              </div>
                            </div>
                          </FormItem>
                        </Col>
                      </Row>
                      <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                          <FormItem label="作业负责人确认签字：" prop="workChargeSign">
                            <Upload
                                multiple
                                :before-upload="beforeUploadWorkChargeSign"
                                ref="upload"
                                type="drag"
                                name="files"
                                :format="['jpg','jpeg','png']"
                            >
                              <div style="padding: 5px 0">
                                <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                              </div>
                            </Upload>
                            <div v-for="(fileItem,index) in signFileList" :key='fileItem.id'>
                              <div v-if="fileItem.fileName.indexOf('workChargeSign')!=-1">
                                <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                  <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                                </router-link>
                                <a @click="downloadFiles(fileItem)"><span
                                    style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                                </a>
                                <a @click="signFileRemove(index,fileItem.id)"><span
                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                </a>
                              </div>
                            </div>
                          </FormItem>
                        </Col>
                      </Row>
                      <Row type="flex" justify="space-around" class="code-row-bg">
                        <Col span="23">
                          <FormItem label="附件：" prop="workPeopleSign">
                            <Upload
                                multiple
                                :before-upload="beforeUploadConfirmPhoto"
                                ref="upload"
                                type="drag"
                                name="files"
                                :format="['jpg','jpeg','png']"
                            >
                              <div style="padding: 5px 0">
                                <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                              </div>
                            </Upload>
                            <div v-for="(fileItem,index) in signPhotoFileList" :key='fileItem.id'>
                              <router-link target="_blank" :to="{path:'/imgDetails',query:{id:fileItem.id}}">
                                <img :src="fileItem.allPath" alt="" style="width: 50px;height: 50px;">
                              </router-link>
                              <a @click="downloadFiles(fileItem)"><span
                                  style="color: #3399ff;margin-left: 5px"> {{ fileItem.fileName }}</span>
                              </a>
                              <a @click="signPhotoRemove(index,fileItem.id)"><span
                                  style="color: #3399ff;margin-left: 5px">删除</span>
                              </a>
                            </div>
                          </FormItem>
                        </Col>
                      </Row>
                    </Form>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000005'"> <!--动火-->
                  <p slot="title">气体浓度检测分析记录</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Button style="margin-top:20px" class="ivu-btn-add" icon="md-add" @click="addGas()">新增
                        </Button>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Table class="tableClass" highlight-row stripe border
                               style="overflow-y:auto;"
                               :height="200" :columns="donghuoGasColumn" :data="beforeGasDatas">
                          <template slot-scope="{ row, index }" slot="checkResult">
                            <RadioGroup v-model="beforeGasDatas[index].checkResult">
                              <Radio label="1">符合</Radio>
                              <Radio label="2">不符合</Radio>
                            </RadioGroup>
                          </template>
                          <template slot-scope="{ row,index }" slot="checkUserSign">
                            <div style="display:flex;flex-direction:column;justify-content:center"
                                 @click="currentGasDataIndex = index">
                              <Upload
                                  action=""
                                  multiple
                                  :before-upload="beforeUploadFile"
                                  ref="upload"
                                  type="drag"
                                  name="files"
                                  :format="['jpg','jpeg','png']"
                              >
                                <div style="padding: 5px 0">
                                  <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                  <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                                </div>
                              </Upload>
                              <div style="display:flex;flex-direction:column;justify-content:center"
                                   v-if="beforeGasDatas[index].file != null && beforeGasDatas[index].file != undefined">
                                <router-link target="_blank"
                                             :to="{path:'/imgDetails',query:{id: beforeGasDatas[index].file.id}}">
                                  <img :src=" beforeGasDatas[index].file.allPath" alt=""
                                       style="width: 50px;height: 50px;">
                                </router-link>
                                <a @click="downloadFiles( beforeGasDatas[index].file)"><span
                                    style="color: #3399ff;margin-left: 5px"> {{
                                    beforeGasDatas[index].file.fileName
                                  }}</span>
                                </a>
                                <a @click="beforeGasRemove(index,beforeGasDatas[index].file.id)"><span
                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                </a>
                              </div>
                            </div>
                          </template>
                        </Table>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow
                      v-if="modelData.modelType=='ptw-100001000000002' || modelData.modelType=='ptw-100001000000003'">
                  <!--有限空间-->
                  <p slot="title">气体浓度检测分析记录</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Button style="margin-top:20px" class="ivu-btn-add" icon="md-add" @click="addGas()">新增
                        </Button>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Table class="tableClass" highlight-row stripe border
                               style="overflow-y:auto;"
                               :height="200" :columns="youxianGasColumn" :data="beforeGasDatas">
                          <template slot-scope="{ row, index }" slot="checkResult">
                            <RadioGroup v-model="beforeGasDatas[index].checkResult">
                              <Radio label="1">符合</Radio>
                              <Radio label="2">不符合</Radio>
                            </RadioGroup>
                          </template>
                          <template slot-scope="{ row,index }" slot="checkUserSign">
                            <div style="display:flex;flex-direction:column;justify-content:center"
                                 @click="currentGasDataIndex = index">
                              <Upload
                                  action=""
                                  multiple
                                  :before-upload="beforeUploadFile"
                                  ref="upload"
                                  type="drag"
                                  name="files"
                                  :format="['jpg','jpeg','png']"
                              >
                                <div style="padding: 5px 0">
                                  <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                  <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                                </div>
                              </Upload>
                              <div style="display:flex;flex-direction:column;justify-content:center"
                                   v-if="beforeGasDatas[index].file != null && beforeGasDatas[index].file != undefined">
                                <router-link target="_blank"
                                             :to="{path:'/imgDetails',query:{id: beforeGasDatas[index].file.id}}">
                                  <img :src=" beforeGasDatas[index].file.allPath" alt=""
                                       style="width: 50px;height: 50px;">
                                </router-link>
                                <a @click="downloadFiles( beforeGasDatas[index].file)"><span
                                    style="color: #3399ff;margin-left: 5px"> {{
                                    beforeGasDatas[index].file.fileName
                                  }}</span>
                                </a>
                                <a @click="beforeGasRemove(index,beforeGasDatas[index].file.id)"><span
                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                </a>
                              </div>
                            </div>
                          </template>
                        </Table>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType=='ptw-100001000000007'"> <!--篦冷机清大块-->
                  <p slot="title">气体浓度检测分析记录</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Button style="margin-top:20px" class="ivu-btn-add" icon="md-add" @click="addGas()">新增
                        </Button>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <Table class="tableClass" highlight-row stripe border
                               style="overflow-y:auto;"
                               :height="200" :columns="lengjiGasColumn" :data="beforeGasDatas">
                          <template slot-scope="{ row, index }" slot="checkResult">
                            <RadioGroup v-model="beforeGasDatas[index].checkResult">
                              <Radio label="1">符合</Radio>
                              <Radio label="2">不符合</Radio>
                            </RadioGroup>
                          </template>
                          <template slot-scope="{ row,index }" slot="checkUserSign">
                            <div style="display:flex;flex-direction:column;justify-content:center"
                                 @click="currentGasDataIndex = index">
                              <Upload
                                  action=""
                                  multiple
                                  :before-upload="beforeUploadFile"
                                  ref="upload"
                                  type="drag"
                                  name="files"
                                  :format="['jpg','jpeg','png']"
                              >
                                <div style="padding: 5px 0">
                                  <Icon type="ios-cloud-upload" size="20" style="color: #F27874"></Icon>
                                  <p><span style="color: red">*</span>&nbsp;请上传图片</p>
                                </div>
                              </Upload>
                              <div style="display:flex;flex-direction:column;justify-content:center"
                                   v-if="beforeGasDatas[index].file != null && beforeGasDatas[index].file != undefined">
                                <router-link target="_blank"
                                             :to="{path:'/imgDetails',query:{id: beforeGasDatas[index].file.id}}">
                                  <img :src=" beforeGasDatas[index].file.allPath" alt=""
                                       style="width: 50px;height: 50px;">
                                </router-link>
                                <a @click="downloadFiles( beforeGasDatas[index].file)"><span
                                    style="color: #3399ff;margin-left: 5px"> {{
                                    beforeGasDatas[index].file.fileName
                                  }}</span>
                                </a>
                                <a @click="beforeGasRemove( beforeGasDatas[index].file.id)"><span
                                    style="color: #3399ff;margin-left: 5px">删除</span>
                                </a>
                              </div>
                            </div>
                          </template>
                        </Table>
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow v-if="modelData.modelType!=undefined&&modelData.modelType!=''
                                &&modelData.modelType!='ptw-100001000000023' &&modelData.modelType!='ptw-100001000000024'
                               &&modelData.modelType!='ptw-100001000000025'">
                  <p slot="title">现场应急处置</p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="23">
                        <p>{{ modelData.notes }}</p>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="11">
                        <FormItem label="逃生路径：" prop="escapePath">
                          <Input type="text" v-model="ptwData.escapePath"></Input>
                        </FormItem>
                      </Col>
                      <Col span="11">
                        <FormItem label="其他应急处置：" prop="emergencyHandling">
                          <Input type="text" v-model="ptwData.emergencyHandling"></Input>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="11">
                        <FormItem
                            :label="this.formData.twoLevelOrgId=='18000050'?'站点业务主管部门负责人：':'属地部门安全员：'"
                            prop="belongOrgOfficerName">
                          <Input type="text" v-model="ptwData.belongOrgOfficerName"
                                 @on-focus="choosePeople('belongOrgOfficer')"></Input>
                        </FormItem>
                      </Col>
                      <Col span="11">
                      </Col>
                    </Row>
                  </div>
                </Card>
                <Card shadow
                      v-if="modelData.modelType=='ptw-100001000000023' || modelData.modelType=='ptw-100001000000024'">
                  <p slot="title"></p>
                  <div>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                      <Col span="11">
                        <FormItem label="施工班组：" prop="belongOrgOfficerName">
                          <Input type="text" v-model="ptwData.belongOrgOfficerName"
                                 @on-focus="choosePeople('belongOrgOfficer')"></Input>
                        </FormItem>
                      </Col>
                      <Col span="11">
                      </Col>
                    </Row>
                  </div>
                </Card>
              </Form>
            </div>
            <div v-if="!loadingModel" style="display:flex;justify-content:center">
              <Button class='ivu-btn-save' v-if="currentModelId != ''" style="margin-right:20px" @click="submit()">
                保存
              </Button>
              <Button class='ivu-btn-cancel' @click="$router.go(-1)">返回</Button>
            </div>
          </div>
        </div>
      </TabPane>
    </Tabs>

    <ptwTicketRelatedPartySelect ref="ptwTicketRelatedPartySelect" @closeModel="closeModel"
                                 @getSelectData="getRelatedPartySelectData"
                                 :relatedPartyForSelectModal="ptwTicketRelatedPartyForSelectModal"
                                 :companyId="companyId">
    </ptwTicketRelatedPartySelect>

    <ptwTicketUserSelect ref="ptwTicketUserSelect" @closeModel="closeModel" @getSelectData="getSelectData"
                         :userForSelectModal="ptwTicketUserForSelectModal" :orgId="companyId">
    </ptwTicketUserSelect>

    <Modal title="选择作业许可证" :transfer=false :width=600 :closable="false" :mask-closable="false"
           v-model="ptwModelSelectVisible">
      <CheckboxGroup v-model="selectedPtwModels">
        <Checkbox v-for="(item,index) in ptwModels" :label="item.modelId" :key="item.modelId">{{ item.modelName }}
        </Checkbox>
      </CheckboxGroup>

      <div slot="footer">
        <Button class='ivu-btn-save' @click="selectPtwModels()">确定</Button>
        <Button type="text" class='ivu-btn-cancel' @click="cancelPtwModels">取消</Button>
      </div>
    </Modal>
  </div>
</template>

<script>

var cascaderDom = () => import('@/components/cascader-dom.vue');
import {Api} from '../../../../api/index.js'
import {sessionStorage, cookie} from '../../../../common/cacheUtils.js';
import PtwTicketUserSelect from './ptwTicketUserSelect.vue'
import ptwTicketRelatedPartySelect from './ptwTicketRelatedPartySelect.vue'

export default {
  components: {
    cascaderDom,
    PtwTicketUserSelect,
    ptwTicketRelatedPartySelect
  },
  data() {
    return {
      imgs: [],
      changeSelectStyle: '',
      loadingModel: false,
      companyId: "",
      currentGasDataIndex: 0,
      signFileList: [],
      signPhotoFileList: [],
      conheight: {
        height: ''
      },
      tabHeight: {
        height: ''
      },
      tab2Height: {
        display: 'flex',
        height: ''
      },
      beforeGasDatas: [],
      relatedPartyDatas: [],
      relatedPartyColumn: [
        {
          type: 'index',
          width: 80,
          align: 'center',
          title: '序号',
        },
        {
          title: '相关方',
          minWidth: 120,
          align: 'center',
          slot: 'relatedPartyName',

        },
        {
          title: '联系人',
          minWidth: 100,
          align: 'center',
          slot: 'contactPerson',

        },
        {
          title: '联系电话',
          minWidth: 120,
          align: 'center',
          slot: 'contactPhone',

        },
        {
          title: '操作',
          slot: 'actions',
          align: 'center',
          //  fixed: 'right',
          minWidth: 100
        }
      ],
      ptwWorkerDatas: [],
      ptwWorkerColumn: [
        {
          type: 'index',
          width: 80,
          align: 'center',
          title: '序号',
        },
        {
          title: '作业人员',
          minWidth: 120,
          align: 'center',
          slot: 'userName',
        },
        {
          title: '人员类型',
          width: 120,
          align: 'center',
          slot: 'userType',
        },
        {
          title: '证件号',
          minWidth: 120,
          align: 'center',
          slot: 'userNumber',
        },
        {
          title: '操作',
          slot: 'actions',
          align: 'center',
          minWidth: 120,
        }
      ],
      youxianGasColumn: [
        {
          type: 'index',
          minWidth: 70,
          align: 'center',
          title: '序号',
        },
        {
          title: '检测时间',
          minWidth: 170,
          align: 'center',
          key: 'checkTime',
          render: (h, params) => {
            return h('DatePicker', {
              props: {
                type: 'datetime',
                placement: 'bottom-end',
                transfer: true,
                format: 'yyyy-MM-dd HH:mm',
                value: params.row.checkTime
              },
              on: {
                'on-change': (event) => {
                  params.row.checkTime = new Date(event);
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '检测部位',
          minWidth: 100,
          align: 'center',
          key: 'checkSite',
          render: (h, params) => {
            return h('Input', {
              props: {
                type: 'text',
                value: params.row.checkSite
              },
              on: {
                'on-change': (event) => {
                  params.row.checkSite = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: 'O2 19.5%-23.5%',
          minWidth: 80,
          align: 'center',
          key: 'oxygenConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.oxygenConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.oxygenConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: 'CO 24ppm',
          minWidth: 80,
          align: 'center',
          key: 'toxicGasConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.toxicGasConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.toxicGasConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: 'H2S 10mg/m3',
          minWidth: 80,
          align: 'center',
          key: 'combGasConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.combGasConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.combGasConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '检测结论',
          minWidth: 80,
          align: 'center',
          slot: 'checkResult'
        },
        {
          title: '检测人',
          minWidth: 120,
          align: 'center',
          slot: 'checkUserSign'
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          fixed: 'right',
          minWidth: 120,
          render: (h, params) => {
            return h('div', [
              h('A', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  color: 'red',
                  fontSize: '14px'
                },
                on: {
                  click: () => {
                    this.$Modal.confirm({
                      title: '数据删除',
                      content: '<p>确定删除该条信息</p>',
                      okText: '确认',
                      onOk: () => {
                        this.deleteGas(params.index);
                      },
                      cancelText: '取消'
                    });

                  }
                }
              }, '删除')
            ]);
          }
        }
      ],
      donghuoGasColumn: [
        {
          type: 'index',
          minWidth: 70,
          align: 'center',
          title: '序号',
        },
        {
          title: '检测时间',
          minWidth: 170,
          align: 'center',
          key: 'checkTime',
          render: (h, params) => {
            return h('DatePicker', {
              props: {
                type: 'datetime',
                placement: 'bottom-end',
                transfer: true,
                format: 'yyyy-MM-dd HH:mm',
                value: params.row.checkTime
              },
              on: {
                'on-change': (event) => {
                  params.row.checkTime = new Date(event);
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '检测部位',
          minWidth: 100,
          align: 'center',
          key: 'checkSite',
          render: (h, params) => {
            return h('Input', {
              props: {
                type: 'text',
                value: params.row.checkSite
              },
              on: {
                'on-change': (event) => {
                  params.row.checkSite = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: 'O2 19.5%-23.5%',
          minWidth: 80,
          align: 'center',
          key: 'oxygenConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.oxygenConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.oxygenConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: 'CO 24ppm',
          minWidth: 80,
          align: 'center',
          key: 'toxicGasConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.toxicGasConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.toxicGasConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '可燃气体（V%LEL） 20%-50%',
          minWidth: 80,
          align: 'center',
          key: 'combGasConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.combGasConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.combGasConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '检测结论',
          minWidth: 80,
          align: 'center',
          slot: 'checkResult'
        },
        {
          title: '检测人',
          minWidth: 120,
          align: 'center',
          slot: 'checkUserSign'
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          fixed: 'right',
          minWidth: 120,
          render: (h, params) => {
            return h('div', [
              h('A', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  color: 'red',
                  fontSize: '14px'
                },
                on: {
                  click: () => {
                    this.$Modal.confirm({
                      title: '数据删除',
                      content: '<p>确定删除该条信息</p>',
                      okText: '确认',
                      onOk: () => {
                        this.deleteGas(params.index);
                      },
                      cancelText: '取消'
                    });
                  }
                }
              }, '删除')
            ]);
          }
        }
      ],
      lengjiGasColumn: [
        {
          type: 'index',
          minWidth: 70,
          align: 'center',
          title: '序号',
        },
        {
          title: '检测时间',
          minWidth: 170,
          align: 'center',
          key: 'checkTime',
          render: (h, params) => {
            return h('DatePicker', {
              props: {
                type: 'datetime',
                placement: 'bottom-end',
                transfer: true,
                format: 'yyyy-MM-dd HH:mm',
                value: params.row.checkTime
              },
              on: {
                'on-change': (event) => {
                  params.row.checkTime = new Date(event);
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '检测部位',
          minWidth: 100,
          align: 'center',
          key: 'checkSite',
          render: (h, params) => {
            return h('Input', {
              props: {
                type: 'text',
                value: params.row.checkSite
              },
              on: {
                'on-change': (event) => {
                  params.row.checkSite = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: 'O2 19.5%-23.5%',
          minWidth: 80,
          align: 'center',
          key: 'oxygenConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.oxygenConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.oxygenConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: 'CO 24ppm',
          minWidth: 80,
          align: 'center',
          key: 'toxicGasConcen',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.toxicGasConcen
              },
              on: {
                'on-change': (event) => {
                  params.row.toxicGasConcen = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '45°C',
          minWidth: 80,
          align: 'center',
          key: 'temperature',
          render: (h, params) => {
            return h('Input', {
              props: {
                value: params.row.temperature
              },
              on: {
                'on-change': (event) => {
                  params.row.temperature = event.target.value
                  this.beforeGasDatas[params.index] = params.row;
                }
              }
            });
          }
        },
        {
          title: '检测结论',
          minWidth: 80,
          align: 'center',
          slot: 'checkResult'
        },
        {
          title: '检测人',
          minWidth: 120,
          align: 'center',
          slot: 'checkUserSign'
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          fixed: 'right',
          minWidth: 120,
          render: (h, params) => {
            return h('div', [
              h('A', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  color: 'red',
                  fontSize: '14px'
                },
                on: {
                  click: () => {
                    this.$Modal.confirm({
                      title: '数据删除',
                      content: '<p>确定删除该条信息</p>',
                      okText: '确认',
                      onOk: () => {
                        this.deleteGas(params.index);
                      },
                      cancelText: '取消'
                    });

                  }
                }
              }, '删除')
            ]);
          }
        }
      ],
      rootOrgId: "",
      necessaryItems: [],
      modelData: {},
      currentChoosePeople: "",
      ptwTicketUserForSelectModal: false,
      ptwTicketRelatedPartyForSelectModal: false,
      ptwData: {},
      currentModelId: "",
      currentPlanId: "",
      currentPtwId: "",
      currentIndex: 0,
      workGrades: [
        {codingCodeId: "ptw-100003000000001", codingName: "一级"},
        {codingCodeId: "ptw-100003000000002", codingName: "二级"},
        {codingCodeId: "ptw-100003000000003", codingName: "三级"}
      ],
      highWorkGrades: [
        {codingCodeId: "ptw-100003000000001", codingName: "特级：＞30米"},
        {codingCodeId: "ptw-100003000000002", codingName: "三级：15-30米"},
        {codingCodeId: "ptw-100003000000003", codingName: "二级：5-15米"},
        {codingCodeId: "ptw-100003000000004", codingName: "一级：2—5米"}
      ],
      fireWorkGrades: [
        {codingCodeId: "ptw-100003000000001", codingName: "特殊动火"},
        {codingCodeId: "ptw-100003000000002", codingName: "一级动火"},
        {codingCodeId: "ptw-100003000000003", codingName: "二级动火"}
      ],
      confinedSpaceWorkGrades: [
        {codingCodeId: "ptw-100003000000001", codingName: "特级"},
        {codingCodeId: "ptw-100003000000002", codingName: "一级"},
        {codingCodeId: "ptw-100003000000003", codingName: "二级"}
      ],
      soilWorkGrades: [
        {codingCodeId: "ptw-100003000000001", codingName: "主干道"},
        {codingCodeId: "ptw-100003000000002", codingName: "次干道"},
      ],
      workTypes: [
        {codingCodeId: "ptw-100002000000001", codingName: "运行"},
        {codingCodeId: "ptw-100002000000002", codingName: "停机"},
        {codingCodeId: "ptw-100002000000003", codingName: "检修"},
        {codingCodeId: "ptw-100002000000004", codingName: "其他"}
      ],
      workItems: [],
      detailRow1: 'detailRow1',
      detailRow2: 'detailRow2',
      others: [],
      formData: {},
      currentabName: "name1",
      ptwModels: [],
      ptwModelSelectVisible: false,
      relatedPartySelectVisible: false,
      selectedPtwModels: [],
      currentPtwModels: [],
      resIdentify: false,
      dateDisabledOption: {
          disabledDate (date) {
              return date && date.valueOf() <= Date.now()- 86400000;//不能选今天之前的日期
          }
      },
      ptwRuleCustom: {
        adminDept: [
          {required: true, message: '  ', trigger: 'blur'}
        ],
        adminDeptExpediter: [
          {required: true, message: '  ', trigger: 'blur'}
        ],
        workDept: [
          {required: true, message: '  ', trigger: 'blur'}
        ],
        colonyDept: [
          {required: true, message: '  ', trigger: 'blur'}
        ],
        workType: [
          {required: true, message: '  ', trigger: 'blur'}
        ],
        workGrade: [
          {required: true, message: '  ', trigger: 'blur'}
        ],
        applyStartDate: [{
          validator: (rule, value, callback) => {
            if (value == null || value == '' || value == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }
        ],
        applyEndDate: [{
          validator: (rule, value, callback) => {
            if (value == null || value == '' || value == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }
        ],
        belongOrgOfficerName: [{
          validator: (rule, value, callback) => {
            if (this.ptwData.belongOrgOfficerName == null || this.ptwData.belongOrgOfficerName == '' || this.ptwData.belongOrgOfficerName == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true,
          trigger: 'change'
        }]
      },
      ruleCustom: {
        planName: [
          {required: true, message: '  ', trigger: 'change'}
        ],
        belongOrgId: [
          {
            validator: (rule, value, callback) => {
              if (this.formData.belongOrgId == null || this.formData.belongOrgId == '' || this.formData.belongOrgId == undefined) {
                callback(' ')
              } else {
                callback()
              }
            },
            required: true, message: '  ', trigger: 'blur'
          }
        ],
        operateOrgId: [{
          validator: (rule, value, callback) => {
            if (this.formData.operateOrgId == null || this.formData.operateOrgId == '' || this.formData.operateOrgId == undefined) {
              callback(' ')
            } else {
              callback()
            }
          },
          required: true, message: '  ', trigger: 'blur'
        }
        ],
        workDate: [{
          validator: (rule, value, callback) => {
            if (value == null || value == '' || value == undefined) {
              callback(' ')
            } else {
              callback()
            }
          }, required: true, message: '  ', trigger: 'blur'
        }
        ]
      }
    }
  },
  mounted() {
    this.conheight.height = window.innerHeight - 120 + 'px';
    this.tabHeight.height = window.innerHeight - 156 + 'px';
    this.tab2Height.height = window.innerHeight - 156 + 'px';
    this.companyId = sessionStorage('userId').getObject('userId').companyId;
    this.rootOrgId = sessionStorage('userId').getObject('userId').companyId;
    this.queryPtwModel();
    this.formData = this.$route.params.data;
    if (this.formData != null && this.formData.planId != '' && this.formData.planId != undefined) {
      var data = {
        planId: this.formData.planId,
        size: 100
      }
      this.ptwData.planId = this.formData.planId;
      this.currentPlanId = this.formData.planId;
      if (this.formData.orgType == "0") {
        setTimeout(() => {
          this.$refs.operateOrg.setCurrentOrg();
        }, 100);
      }
      setTimeout(() => {
        this.$refs.belongOrg.setCurrentOrg();
      }, 100);
      this.queryPtwTicketByPlanId(this.formData.planId);
    } else {
      this.formData.belongOrgId = sessionStorage('userId').getObject('userId').companyId;
      this.formData.belongOrgName = sessionStorage('userId').getObject('userId').companyName;
      setTimeout(() => {
        this.$refs.belongOrg.setCurrentOrg();
      }, 100);
    }
  },
  methods: {
    tabClick(name) {
      this.currentabName = name;
    },
    changeType(type) {
      this.formData.operateOrgId = "";
      this.formData.operateOrgName = "";
    },
    addGas() {
      let item;
      item = {
        combGasConcen: 1,
        checkTime: '',
        checkSite: '',
        oxygenConcen: 1,
        toxicGasConcen: 1,
        checkResult: "1",
        temperature: '',
        fileList: []
      };
      this.beforeGasDatas.push(item);
    },
    deleteGas(index) {
      if (this.beforeGasDatas[index].gasCheckId != null && this.beforeGasDatas[index].gasCheckId != undefined && this.beforeGasDatas[index].gasCheckId != "") {
        this.$http.delete(Api.deleteGasById + "/" + this.beforeGasDatas[index].gasCheckId).then((res) => {
        }).catch(e => {
          this.$Message.error("数据删除失败")
        })
      }
      this.beforeGasDatas.splice(index, 1);
    },
    addPtwWorker() {
      let item = {userName: null, userType: null, userNumber: null};
      this.ptwWorkerDatas.push(item);
    },
    deletePtwWorker(index) {
      this.$Modal.confirm({
        title: '数据删除',
        content: '<p>确定删除该条信息</p>',
        okText: '确认',
        onOk: () => {
          if (this.ptwWorkerDatas[index].id != null && this.ptwWorkerDatas[index].id != undefined && this.ptwWorkerDatas[index].id != "") {
            this.$http.delete(Api.deletePtwWorkerById + "/" + this.ptwWorkerDatas[index].id).then((res) => {
            }).catch(e => {
              this.$Message.error("数据删除失败")
            })
          }
          this.ptwWorkerDatas.splice(index, 1);
        },
        cancelText: '取消'
      });
    },
    addRelatedParty() {
      let item = {contactPerson: null, relatedPartyName: null, contactPhone: null};
      this.relatedPartyDatas.push(item);
    },
    deleteRelatedParty(index) {
      this.$Modal.confirm({
        title: '数据删除',
        content: '<p>确定删除该条信息</p>',
        okText: '确认',
        onOk: () => {
          this.relatedPartyDatas.splice(index, 1);
          if (this.relatedPartyDatas[index].id != "" && this.relatedPartyDatas[index].id != null && this.relatedPartyDatas[index].id == undefined) {
            this.$http.delete(Api.deleteRelatedPartyById + "/" + this.relatedPartyDatas[index].id).then((res) => {
            }).catch(e => {
              this.$Message.error("数据删除失败")
            })
          }
        },
        cancelText: '取消'
      });
    },
    setBelongOrgId(data) {
      this.formData.belongOrgId = data[data.length - 1];
    },
    setBelongOrgName(data) {
      this.formData.belongOrgName = data;
    },
    setOperateOrgId(data) {
      this.formData.operateOrgId = data[data.length - 1];
    },
    setOperateOrgName(data) {
      this.formData.operateOrgName = data;
    },
    selectModel() {
      this.selectedPtwModels = [];
      this.ptwModelSelectVisible = true;
    },
    chooseRelatedParty() {
      this.$refs.ptwTicketRelatedPartySelect.reset();
      this.ptwTicketRelatedPartyForSelectModal = true;
    },
    choosePeople(name) {
      this.currentChoosePeople = name;
      this.$refs.ptwTicketUserSelect.reset();
      this.ptwTicketUserForSelectModal = true;
    },
    closeModel() {
      this.ptwTicketRelatedPartyForSelectModal = false;
      this.ptwTicketUserForSelectModal = false;
    },
    getChildPosition(index, itemId, instanceContent) {
      this.others.push({index: index, itemId: itemId, instanceContent: instanceContent})
    },
    getRelatedPartySelectData(relatedParty) {
      if (this.currentabName == "name1") {
        this.formData.operateOrgId = relatedParty.accountId;
        this.formData.operateOrgName = relatedParty.contractorName;
      } else {

      }
    },
    getSelectData(user) {
      if (this.currentChoosePeople == 'belongOrgOfficer') {
        this.ptwData.belongOrgOfficer = user.userId
        this.ptwData.belongOrgOfficerName = user.userName
      }
      if (this.currentChoosePeople == 'belongOrgLeader') {
        this.ptwData.belongOrgLeader = user.userId
        this.ptwData.belongOrgLeaderName = user.userName
      }
      if (this.currentChoosePeople == 'bussinessDept') {
        this.ptwData.bussinessDept = user.userId
        this.ptwData.bussinessDeptName = user.userName
      }
      if (this.currentChoosePeople == 'securityDept') {
        this.ptwData.securityDept = user.userId
        this.ptwData.securityDeptName = user.userName
      }
      if (this.currentChoosePeople == 'securityDirect') {
        this.ptwData.securityDirect = user.userId
        this.ptwData.securityDirectName = user.userName
      }
      if (this.currentChoosePeople == 'chargeLeader') {
        this.ptwData.chargeLeader = user.userId
        this.ptwData.chargeLeaderName = user.userName
      }
      this.ptwTicketUserForSelectModal = false;
    },
    queryPtwModel() {
      let data = {
        belongOrgId: sessionStorage('userId').getObject('userId').companyId,
        userId: sessionStorage('userId').getObject('userId').userId
      }
      this.$http.get(Api.queryPtwModelList, {params: data}).then((res) => {
        this.ptwModels = [];
        res.data.forEach(item => {
          this.ptwModels.push(item);
        })
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    queryPtwTicketByPlanId(planId) {
      this.$http.get(Api.queryPtwModelListByPlanId + "/" + planId).then((res) => {
        this.currentPtwModels = [];
        this.currentPtwModels = res.data;
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    async submit() {
      if (this.currentabName == "name1") {
        this.$refs["formData"].validate((valid) => {
          if (valid) {
            this.$http.post(Api.saveOrUpdatePtwPlan, this.formData).then((res) => {
              if (res.status === 200) {
                this.$Message.success('成功');
                if (this.resIdentify) {
                  this.$router.go(-1);
                }
                this.currentabName = 'name2';
                this.currentPlanId = res.data.planId;
                this.ptwData.planId = res.data.planId;
              } else if (res.data.status === 201) {
                this.resIdentify = false;
                this.$Message.error(res.data.msg);
              }
            }).catch(e => {
              this.$Message.error("数据获取失败")
            })
          } else {
            this.resIdentify = false;
            this.$Message.error('不能为空!');
          }
        })
      } else {
        this.$refs["ptwData"].validate((valid) => {
          if (valid) {
            var over = false;
            for (let i = 0; i < this.workItems.length; i++) {
              for (let j = 0; j < this.workItems[i].rows.length; j++) {
                for (let x = 0; x < this.workItems[i].rows[j].length; x++) {
                  if (this.workItems[i].modelSubName.indexOf('控制措施') != -1) {
                    if (this.workItems[i].rows[j][x].dataType == '3' &&
                        this.workItems[i].rows[j][x].instanceContent == '') {
                      this.$Message.error('控制措施必填项未勾选');
                      over = true;
                      this.resIdentify = false;
                      return;
                    }
                  } else {
                    if (this.workItems[i].rows[j][x].dataType == '3' &&
                        this.workItems[i].rows[j][x].instanceContent != '1') {
                      this.$Message.error('风险分析必填项未勾选');
                      over = true;
                      this.resIdentify = false;
                      return;
                    }
                  }
                }
              }
            }
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) == 0) {
              this.$Message.error("作业结束时间不能早于开始时间");
              return;
            }
            if (this.modelData.modelType == 'ptw-100001000000001') {
              if (this.ptwData.workGrade == 'ptw-100003000000001')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
                  this.$Message.error("一级吊装作业许可证有效期不能超过8小时");
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000002')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 24) {
                  this.$Message.error("二级吊装作业许可证有效期不能超过24小时");
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000003')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
                  this.$Message.error("三级吊装作业许可证有效期不能超过48小时");
                  return;
                }
            }
            if (this.modelData.modelType == 'ptw-100001000000002' || this.modelData.modelType == 'ptw-100001000000003') {
              if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
                if (this.modelData.modelType == 'ptw-100001000000002')
                  this.$Message.error("清库清仓作业许可证有效期不能超过8小时");
                else
                  this.$Message.error("有限空间作业许可证有效期不能超过8小时");
                this.resIdentify = false;
                return;
              }
            }
            if (this.modelData.modelType == 'ptw-100001000000004') {
              if (this.ptwData.workGrade == 'ptw-100003000000001')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
                  this.$Message.error("特级高处作业许可证有效期不能超过8小时");
                  this.resIdentify = false;
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000002')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 24) {
                  this.$Message.error("三级高处作业许可证有效期不能超过24小时");
                  this.resIdentify = false;
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000003')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
                  this.$Message.error("二级高处作业许可证有效期不能超过48小时");
                  this.resIdentify = false;
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000004')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 72) {
                  this.$Message.error("一级高处作业许可证有效期不能超过72小时");
                  this.resIdentify = false;
                  return;
                }
            }
            if (this.modelData.modelType == 'ptw-100001000000005') {
              if (this.ptwData.workGrade == 'ptw-100003000000001')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
                  this.$Message.error("特殊动火作业许可证有效期不能超过8小时");
                  this.resIdentify = false;
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000002')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
                  this.$Message.error("一级动火作业许可证有效期不能超过8小时");
                  this.resIdentify = false;
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000003')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 24) {
                  this.$Message.error("二级动火作业许可证有效期不能超过24小时");
                  this.resIdentify = false;
                  return;
                }
            }
            if (this.modelData.modelType == 'ptw-100001000000006') {
              if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 12) {
                this.resIdentify = false;
                this.$Message.error("预热器清堵作业许可证有效期不能超过12小时");
                return;
              }
            }
            if (this.modelData.modelType == 'ptw-100001000000007') {
              if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
                this.$Message.error("篦冷机清大块作业许可证有效期不能超过8小时");
                this.resIdentify = false;
                return;
              }
            }
            /*if(this.modelData.modelType=='ptw-100001000000008'){
                                if(this.getHour(this.ptwData.applyStartDate,this.ptwData.applyEndDate)>15*24){
                                    this.$Message.error("临时用电作业许可证有效期不能超过15天");
                                    this.resIdentify = false;
                                    return ;
                                }
                            }*/
            if (this.modelData.modelType == 'ptw-100001000000009' || this.modelData.modelType == 'ptw-100001000000010') {
              if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
                if (this.modelData.modelType == 'ptw-100001000000009')
                  this.$Message.error("高温作业许可证有效期不能超过48小时");
                else
                  this.$Message.error("交叉作业许可证有效期不能超过48小时");
                this.resIdentify = false;
                return;
              }
            }
            if (this.modelData.modelType == 'ptw-100001000000011') {
              if (this.ptwData.workGrade == 'ptw-100003000000001')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
                  this.$Message.error("交通主干道动土作业许可证有效期不能超过48小时");
                  this.resIdentify = false;
                  return;
                }
              if (this.ptwData.workGrade == 'ptw-100003000000002')
                if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 72) {
                  this.$Message.error("交通次干道动土作业许可证有效期不能超过72小时");
                  this.resIdentify = false;
                  return;
                }
            }
            this.loadingModel = true;
            let updateDatas = {};
            let itemData = [];
            for (let i = 0; i < this.workItems.length; i++) {
              for (let j = 0; j < this.workItems[i].rows.length; j++) {
                for (let x = 0; x < this.workItems[i].rows[j].length; x++) {
                  let obj = {};
                  if (this.workItems[i].rows[j][x].instanceContent == true || this.workItems[i].rows[j][x].instanceContent == "true") {
                    obj = {itemId: this.workItems[i].rows[j][x].itemId, instanceContent: "1"};
                  } else
                    obj = {
                      itemId: this.workItems[i].rows[j][x].itemId,
                      instanceContent: this.workItems[i].rows[j][x].instanceContent
                    };
                  itemData.push(obj);
                }
              }
            }
            updateDatas.itemData = itemData;
            this.ptwData.modelId = this.currentModelId;
            this.ptwData.planId = this.currentPlanId;
            updateDatas.ptw = this.ptwData;
            updateDatas.beforeGasDatas = this.beforeGasDatas;
            updateDatas.relatedParties = this.relatedPartyDatas;
            updateDatas.ptwWorkers = this.ptwWorkerDatas;
            this.$http.post(Api.saveOrUpdatePtw, updateDatas).then(async (res1) => {
              if (res1.data.result == 'success') {
                this.queryPtwTicketByPlanId(this.ptwData.planId);
                this.$Message.success('保存成功');
                if (this.resIdentify) {
                  this.$router.go(-1);
                  return;
                }
                this.currentPtwId = res1.data.ids.ptwId;
                await this.viewByPtwId(this.currentPtwId, this.currentModelId);
                this.loadingModel = false;
              }
            }).catch(e => {
              this.resIdentify = false;
              this.loadingModel = false;
              this.$Message.error("数据获取失败")
            })
          } else {
            this.resIdentify = false;
            this.$Message.error('不能为空!');
          }
        })
      }
    },
    changeDate(date) {
      if (this.ptwData.applyEndDate != undefined && this.ptwData.applyEndDate != '' &&
          this.ptwData.applyStartDate != undefined && this.ptwData.applyStartDate != '') {
        if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) == 0) {
          this.$Message.error("作业结束时间不能早于开始时间");
          return;
        }
        if (this.modelData.modelType == 'ptw-100001000000001') {
          if (this.ptwData.workGrade == 'ptw-100003000000001')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
              this.$Message.error("一级吊装作业许可证有效期不能超过8小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000002')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 24) {
              this.$Message.error("二级吊装作业许可证有效期不能超过24小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000003')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
              this.$Message.error("三级吊装作业许可证有效期不能超过48小时");
              return;
            }
        }
        if (this.modelData.modelType == 'ptw-100001000000002' || this.modelData.modelType == 'ptw-100001000000003') {
          if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
            if (this.modelData.modelType == 'ptw-100001000000002')
              this.$Message.error("清库清仓作业许可证有效期不能超过8小时");
            else
              this.$Message.error("有限空间作业许可证有效期不能超过8小时");
            return;
          }
        }
        if (this.modelData.modelType == 'ptw-100001000000004') {
          if (this.ptwData.workGrade == 'ptw-100003000000001')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
              this.$Message.error("特级高处作业许可证有效期不能超过8小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000002')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 24) {
              this.$Message.error("三级高处作业许可证有效期不能超过24小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000003')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
              this.$Message.error("二级高处作业许可证有效期不能超过48小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000004')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 72) {
              this.$Message.error("一级高处作业许可证有效期不能超过72小时");
              return;
            }
        }
        if (this.modelData.modelType == 'ptw-100001000000005') {
          if (this.ptwData.workGrade == 'ptw-100003000000001')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
              this.$Message.error("特殊动火作业许可证有效期不能超过8小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000002')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
              this.$Message.error("一级动火作业许可证有效期不能超过8小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000003')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 24) {
              this.$Message.error("二级动火作业许可证有效期不能超过24小时");
              return;
            }
        }
        if (this.modelData.modelType == 'ptw-100001000000006') {
          if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 12) {
            this.$Message.error("预热器清堵作业许可证有效期不能超过12小时");
            return;
          }
        }
        if (this.modelData.modelType == 'ptw-100001000000007') {
          if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 8) {
            this.$Message.error("篦冷机清大块作业许可证有效期不能超过8小时");
            return;
          }
        }
        /*if(this.modelData.modelType=='ptw-100001000000008'){
                        if(this.getHour(this.ptwData.applyStartDate,this.ptwData.applyEndDate)>15*24){
                            this.$Message.error("临时用电作业许可证有效期不能超过15天");
                            return ;
                        }
                    }*/
        if (this.modelData.modelType == 'ptw-100001000000009' || this.modelData.modelType == 'ptw-100001000000010') {
          if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
            if (this.modelData.modelType == 'ptw-100001000000009')
              this.$Message.error("高温作业许可证有效期不能超过48小时");
            else
              this.$Message.error("交叉作业许可证有效期不能超过48小时");
            return;
          }
        }
        if (this.modelData.modelType == 'ptw-100001000000011') {
          if (this.ptwData.workGrade == 'ptw-100003000000001')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 48) {
              this.$Message.error("交通主干道动土作业许可证有效期不能超过48小时");
              return;
            }
          if (this.ptwData.workGrade == 'ptw-100003000000002')
            if (this.getHour(this.ptwData.applyStartDate, this.ptwData.applyEndDate) > 72) {
              this.$Message.error("交通次干道动土作业许可证有效期不能超过72小时");
              return;
            }
        }
      }
    },
    handleCancel() {
      this.$router.go(-1);
    },
    selectPtwModels() {
      this.ptwModelSelectVisible = false;
      this.selectedPtwModels.forEach(item => {
        this.ptwModels.forEach(item1 => {
          if (item1.modelId == item) {
            this.currentPtwModels.push(item1);
          }
        })
      })
    },
    cancelPtwModels() {
      this.ptwModelSelectVisible = false;
    },
    clickModel(index, ptwId, modelId) {
      this.loadingModel = true;
      this.resIdentify = false;
      this.signFileList = [];
      this.beforeGasDatas = [];
      this.signPhotoFileList = [];
      this.currentIndex = index;
      this.ptwData = {};
      this.others = [];
      this.currentModelId = modelId;
      this.currentPtwId = ptwId;
      this.$http.get(Api.getPtwModelByModelId + "/" + this.currentModelId).then((res) => {
        this.modelData = res.data;
      }).catch(e => {
        this.$Message.error("数据获取失败")
      });
      if (this.currentPtwId != "" && this.currentPtwId != undefined)
        this.viewByPtwId(this.currentPtwId, this.currentModelId);
      else
        this.getPtwModelItemByModelId();
      this.loadingModel = false;
    },
    deleteModel(index, ptwId) {
      this.$Modal.confirm({
        title: '数据删除',
        content: '<p>确定删除该条信息</p>',
        okText: '确认',
        onOk: () => {
          if (ptwId == undefined || ptwId == "") {
            this.$Message.success('删除成功');
            this.currentPtwModels.splice(index, 1);
            if (index == this.currentIndex) {
              this.ptwData = {};
              this.workItems = [];
              this.others = [];
            }
          } else {
            this.$http.get(Api.deletePTW + "?ptwId=" + ptwId).then((res) => {
              this.$Message.success('删除成功');
              this.currentPtwModels.splice(index, 1);
              if (index == this.currentIndex) {
                this.ptwData = {};
                this.workItems = [];
                this.others = [];
              }
            }).catch(e => {
              this.$Message.error("数据获取失败")
            });
          }
        },
        cancelText: '取消'
      });
    },
    viewByPtwId(ptwId, modelId) {
      this.imgs = [];
      this.workItems = [];
      this.beforeGasDatas = [];
      this.relatedPartyDatas = [];
      let url = Api.queryPTWDetail;
      this.$http.get(Api.queryPTWDetail + '/' + ptwId, {params: {}}).then((res) => {
        this.beforeGasDatas = res.data.beforeGasDatas;
        this.relatedPartyDatas = res.data.relatedParties;
        this.ptwWorkerDatas = res.data.ptwWorkers;
        var index = 0;
        this.ptwData = res.data.ptwData;
        this.workItems = res.data.itemData;
        this.workItems.map(subitem => {
          let childs = subitem.itemList;
          let rowNum = childs.length / 4;
          subitem.rows = [];
          for (let i = 0; i < rowNum; i++) {
            subitem.rows[i] = [];
            for (let j = 0; j < subitem.itemList.length - i * 4; j++) {
              let flag = (j + 1) % 4;
              let index = i * 4 + j;
              if (subitem.itemList[index].instanceContent == null)
                subitem.itemList[index].instanceContent = "";
              subitem.itemList[index].fileUrl = Api.uploadPTWFiles + '/' + this.ptwData.ptwId + '/files/picture?field=' + subitem.itemList[index].itemId;
              subitem.itemList[index].fileList = [];
              subitem.rows[i].push(subitem.itemList[index]);
              if (flag == 0) {
                break;
              }
            }
          }
          //如果最后一行不满4个，添加空数据补满
          if (subitem.rows.length > 0) {
            let diff = 4 - subitem.rows[subitem.rows.length - 1].length;
            for (let i = 0; i < diff; i++) {
              subitem.rows[subitem.rows.length - 1].push({fileList: [], fileUrl: ''});
            }
          }
          this.beforeGasDatas.forEach(item => {
            this.getFileInfoById(index, item.checkUserSign);
            index++;
          })
          //   this.getSignPicture('confirm');
        })
      }).catch(e => {
        console.log(e)
        this.$Message.error("数据获取失败")
      })
      this.$http.get(Api.uploadPTWFiles + '/' + ptwId + '/filePaths/picture').then((imgRes) => {
        this.imgs = imgRes.data.data;
        this.imgs.forEach(item => {
          item.allPath = Api.viewPicture + item.filePath;
          if (item.field == "confirm") {
            this.signFileList.push(item);
          } else if (item.field == "confirmPhoto") {
            this.signPhotoFileList.push(item);
          }
        })
      })
    },
    getPtwModelItemByModelId() {
      this.imgs = [];
      this.ptwData.ptwId = this.uuid();
      this.workItems = [];
      this.beforeGasDatas = [];
      this.relatedPartyDatas = [];
      this.$http.get(Api.getPtwModelItemByModelId + "/" + this.currentModelId).then((res) => {
        this.workItems = res.data;
        this.workItems.map(item => {
          let childs = item.itemList;
          let rowNum = childs.length / 4;
          item.rows = [];
          for (let i = 0; i < rowNum; i++) {
            item.rows[i] = [];
            for (let j = 0; j < item.itemList.length - i * 4; j++) {
              let flag = (j + 1) % 4;
              let index = i * 4 + j;
              if (item.modelSubName.indexOf("风险分析") != -1) {
                if (item.itemList[index].dataType == '3')
                  item.itemList[index].instanceContent = "1";
              }
              if (item.itemList[index].instanceContent == null)
                item.itemList[index].instanceContent = "";
              item.itemList[index].fileUrl = Api.uploadPTWFiles + '/' + this.ptwData.ptwId + '/files/picture?field=' + item.itemList[index].itemId;
              item.itemList[index].fileList = [];
              item.rows[i].push(item.itemList[index]);
              if (flag == 0) {
                break;
              }
            }
          }
          //如果最后一行不满4个，添加空数据补满
          if (item.rows.length > 0) {
            let diff = 4 - item.rows[item.rows.length - 1].length;
            for (let i = 0; i < diff; i++) {
              item.rows[item.rows.length - 1].push({fileList: [], fileUrl: ''});
            }
          }
        })
      }).catch(e => {
        this.$Message.error("数据获取失败")
      })
    },
    uuid() {
      let s = [];
      let hexDigits = "0123456789abcdef";
      for (let i = 0; i < 32; i++) {
        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
      }
      s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
      s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
      let uuid = s.join("");
      return uuid
    },
    downloadFiles(file) {
      let url = Api.interestedPartiesUserFile + '/file/' + file.id;
      this.$http.get(url, {
        responseType: 'blob'      //告诉服务器我们需要的响应格式
      }).then((res) => {
        const aLink = document.createElement("a");
        let blob = new Blob([res.data], {
          type: res.bodyBlob.type      //将会被放入到blob中的数组内容的MIME类型
        });
        aLink.href = URL.createObjectURL(blob)
        aLink.download = file.fileName //标题
        aLink.click()
        document.body.appendChild(aLink)
      })
    },
    beforeGasRemove(index, id) {
      let url = Api.uploadPTWFiles + '/file/' + id;
      this.$http.delete(url).then((res) => {
        this.beforeGasDatas.splice(index, 1);
      })
    },
    signFileRemove(index, id) {
      let url = Api.uploadPTWFiles + '/file/' + id;
      this.$http.delete(url).then((res) => {
        this.signFileList.splice(index, 1);
      })
    },
    signPhotoRemove(index, id) {
      let url = Api.uploadPTWFiles + '/file/' + id;
      this.$http.delete(url).then((res) => {
        this.signPhotoFileList.splice(index, 1);
      })
    },
    removeFileToList(upLoadList, id) {
      let url = Api.uploadPTWFiles + '/file/' + id;
      this.$http.delete(url).then((res) => {
        var index = upLoadList.indexOf(id);
        if (index > -1) {
          upLoadList.splice(index, 1);
        }
      })
    },
    getFileInfoById(index, id) {
      if (id != null) {
        this.$http.get(Api.getMongoFileNoBase64Info + '/' + id).then((imgRes) => {
          imgRes.data.allPath = Api.viewPicture + imgRes.data.filePath;
          this.$set(this.beforeGasDatas[index], 'file', imgRes.data);
        })
      }
    },
    beforeUploadFile(file) {
      let formData = new FormData();
      formData.append("file", file);
      this.$http.put(Api.uploadMongoFile, formData).then((res) => {
        if (res.data.result == "success") {
          this.beforeGasDatas[this.currentGasDataIndex].checkUserSign = res.data.id;
          this.getFileInfoById(this.currentGasDataIndex, res.data.id);
          this.$Message.info("文件上传成功")
        }
      })
      return false;
    },
    beforeUploadEleWorkerNameSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "eleWorkerNameSign." + ext);
      this.beforeUploadSign(file1);
      return false;
    },
    beforeUploadEleCheckerNameSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "eleCheckerNameSign." + ext);
      this.beforeUploadSign(file1);
      return false;
    },
    beforeUploadWorkPeopleSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "workPeopleSign." + ext);
      this.beforeUploadSign(file1);
      return false;
    },
    beforeUploadBrokenExplainPhoto(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "file." + ext);
      this.beforeUploadConfirmSign(file1);
      return false;
    },
    beforeUploadSiteGuarderSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "siteGuarderSign." + ext);
      this.beforeUploadSign(file1);
      return false;
    },
    beforeUploadWorkChargeSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "workChargeSign." + ext);
      this.beforeUploadSign(file1);
      return false;
    },
    beforeUploadConfirmPhoto(file) {
      let formData = new FormData();
      formData.append("files", file); // 文件对象
      let url = Api.uploadPTWFiles + '/' + this.ptwData.ptwId + '/files/picture/confirmPhoto';
      this.$http.post(url, formData).then((res) => {
        if (res.data.result == "success") {
          this.getSignPicture('confirm');
          this.$Message.info("文件上传成功")
        }
      })
      return false;
    },
    beforeUploadTechnicianSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "technicianSign." + ext);
      this.beforeUploadConfirmSign(file1);
      return false;
    },
    beforeUploadChargePeopleSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "chargePeopleSign." + ext);
      this.beforeUploadConfirmSign(file1);
      return false;
    },
    beforeUploadSecurityGuardSign(file) {
      var index = file.name.lastIndexOf(".");
      //获取后缀
      var ext = file.name.substr(index + 1);
      var file1 = new File([file], "securityGuardSign." + ext);
      this.beforeUploadConfirmSign(file1);
      return false;
    },
    beforeUploadSign(file) {
      let formData = new FormData();
      formData.append("files", file); // 文件对象
      let url = Api.uploadPTWFiles + '/' + this.ptwData.ptwId + '/files/picture/confirm';
      this.$http.post(url, formData).then((res) => {
        if (res.data.result == "success") {
          this.getSignPicture('confirm');
          this.$Message.info("文件上传成功")
        }
      })
      return false;
    },
    getSignPicture(field) {
      this.$http.get(Api.uploadPTWFiles + '/' + this.ptwData.ptwId + '/filePaths/picture?field=' + field).then((imgRes) => {
        imgRes.data.data.forEach(item => {
          item.allPath = Api.viewPicture + item.filePath;
        })
        this.signFileList = imgRes.data.data;
      })
      this.$http.get(Api.uploadPTWFiles + '/' + this.ptwData.ptwId + '/filePaths/picture?field=confirmPhoto').then((imgRes) => {
        imgRes.data.data.forEach(item => {
          item.allPath = Api.viewPicture + item.filePath;
        })
        this.signPhotoFileList = imgRes.data.data;
      })
    },
    getHour(s1, s2) {
      s1 = new Date(s1);
      s2 = new Date(s2);
      var ms = s2.getTime() - s1.getTime();
      if (ms <= 0) return 0;
      return ms / 1000 / 60 / 60;
    },
    changeStyle(index) {
      this.changeSelectStyle = index;
    },
    formatDate(date, fmt) {
      if (typeof date == 'string') {
        return date;
      }
      if (!fmt) fmt = "yyyy-MM-dd hh:mm:ss";
      if (!date || date == null) return null;
      let o = {
        'M+': date.getMonth() + 1, // 月份
        'd+': date.getDate(), // 日
        'h+': date.getHours(), // 小时
        'm+': date.getMinutes(), // 分
        's+': date.getSeconds(), // 秒
        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
        'S': date.getMilliseconds() // 毫秒
      }
      if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
      for (let k in o) {
        if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
      }
      return fmt
    },
  }
}
</script>
<style lang='css' scoped>
@import '../../../../index.css';


.model-list-css {
  width: 190px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.model-list-css >>> .ivu-card-body {
  padding: 0;
  height: 100%;
  flex: auto;
}

.modelSub {
  margin-top: 10px;
}

.detailRow1 {
  border: 1px solid #E0E0EC;
  font-size: 12px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: rgba(51, 51, 51, 1);
  line-height: 2;
}

.detailRow2 {
  background: rgba(248, 248, 249, 1);
  border-right: 1px solid #E0E0EC;
  border-left: 1px solid #E0E0EC;
  font-size: 12px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: rgba(51, 51, 51, 1);
  line-height: 2;
}

.PtwModelListClass {
  padding: 10px;
  width: 190px;
  border: 1px solid #e8eaec;
}

.PtwModelListClass .wenben:hover {
  cursor: pointer
}

.tableClass {
}

.tableClass >>> .ivu-table td {
  vertical-align: middle;
}

.tableClass >>> .ivu-table th {
  vertical-align: middle;
}

.tableClass >>> .ivu-input-suffix i {
  font-size: 16px;
  line-height: 50px;
  color: #808695;
}


.tableClass >>> .ivu-input {
  border-radius: 0px;
  vertical-align: middle;
  height: 100%;
}

.tableClass >>> textarea.ivu-input {
  height: 100%;
  vertical-align: middle;
}

.tableClass >>> ivu-date-picker {
  height: 100%;
  vertical-align: middle;
}

.tableClass >>> .ivu-table-cell {
  padding-left: 0px;
  padding-right: 0px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-all;
  box-sizing: border-box;
  height: 100%;
  /*flex 布局*/
  display: flex;
  /*实现垂直居中*/
  align-items: center;
  /*实现水平居中*/
  justify-content: center;
  text-align: justify;
}

.tableClass >>> .ivu-date-picker {
  height: 100%;
}

.tableClass >>> .ivu-date-picker {
  height: 100%;
}

.tableClass >>> .ivu-input-wrapper {
  height: 100%;
}

.tableClass >>> .ivu-date-picker-rel {
  height: 100%;
}

.tableClass >>> .ivu-input-icon {
  line-height: 50px;
}


.changeStyle {
  color: #E53935;
  background-color: #fff;
}

.ivu-radio-disabled .ivu-radio-inner:after {
  background-color: black;
}
</style>
